home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library / Microsoft Programmer's Library (CD-ROM Database)(125-099-008)(Version 1.1a)(CDRM 162100)(1989).iso / AUDIO / SEND.ASM < prev   
Assembly Source File  |  1987-10-09  |  1KB  |  49 lines

  1. ; SEND.ASM
  2. ;
  3. ; Simple asm routine to take packaged request from C, point to it
  4. ; with ES:BX, and send it to the device driver.
  5.  
  6. ?PLM = 0    ; Use C calling conventions
  7. ?WIN = 0    ; We're not windows
  8. include cmacros.inc
  9.  
  10. sysdev    struc
  11. sdevnext    dd    ?    ;Pointer to next device header
  12. sdevatt     dw    ?    ;Attributes of the device
  13. sdevstrat    dw    ?    ;Strategy entry point
  14. sdevint     dw    ?    ;Interrupt entry point
  15. sdevname    db    8 dup (?) ;Name of device (only first byte used for block)
  16. sysdev    ends
  17.  
  18. sBegin data
  19. dev_strat    dd    ?
  20. dev_int        dd    ?
  21. sEnd   data
  22.  
  23. sBegin code
  24.     assumes cs, code
  25.     assumes ds, data
  26.  
  27. cProc    send_req, PUBLIC, <si, di>
  28. parmW    req
  29. parmW    reqseg
  30. parmW    drv
  31. parmW    drvseg
  32. cBegin    send_req
  33.     mov    es,drvseg
  34.     mov    word ptr dev_strat+2,es
  35.     mov    word ptr dev_int+2,es
  36.     mov    bx,drv
  37.     mov    ax,es:[bx].sdevstrat
  38.     mov    word ptr dev_strat,ax
  39.     mov    ax,es:[bx].sdevint
  40.     mov    word ptr dev_int,ax
  41.  
  42.     mov    bx,req
  43.     mov    es,reqseg
  44.     call    dword ptr [dev_strat]
  45.     call    dword ptr [dev_int]
  46. cEnd    send_req
  47. sEnd    code
  48. end
  49.